package com.example.film.mapper;

import com.example.film.entity.EachYearSell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EachYearSellMapper {
    //分页查询历年电影内地票房排行信息
    @Select("select id,filmName,link,picture,director,star,type,area,showYear,\n" +
            "score,brief,vidio1,platform1,vidio2,platform2,vidio3,platform3 from eachyearsell LIMIT #{pageSize} OFFSET #{startIndex}")
    List<EachYearSell> findEachYearSellInfo(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    //根据年份分页显示历年电影内地票房排行信息
    @Select("select id,filmName,link,picture,director,star,type,area,showYear,\n" +
            "score,brief,vidio1,platform1,vidio2,platform2,vidio3,platform3 from eachyearsell where showYear=#{year} LIMIT #{pageSize} OFFSET #{startIndex}")
    List<EachYearSell> findEachYearSellByYear(@Param("year") Integer year,@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);
}
